//****************************************************************************
// File Name: Winery.h
// Wine Tours project
// Group #2: Allen McLennan, Ryan Neal, Mike Matz
// CS 1C
// April 28, 2010
// Definition of Winery class
//****************************************************************************

#ifndef WINERY_H_
#define WINERY_H_

#include "config.h"
#include<iostream>
#include<iomanip>
#include<string>

using namespace std;

//MAX_NAME_LENGTH: the length of a char
//	string. Currently 35

const int MAX_NAME_LENGTH = WT_WINERY_MAX_NAME_LENGTH;
const int MAX_WINES = WT_WINERY_MAX_WINES;
const int MAX_WINERIES = WT_MAX_WINERIES;

struct Wine{
	char wineName[MAX_NAME_LENGTH];	//name of the wine
	int vintage;					//vintage of the wine
	float price;					//price of the wine
};

class Winery{

	//Overloaded <<. Outputs name, ID, and list of wines.
	friend ostream& operator<< (ostream&, Winery& );

public:
	//Constructors of Winery class
	Winery();
	Winery(int wineryId);

	//Converts to string format
	string toString();

	//Returns distance to a specified winery
	float GetDistanceToWinery(int wineryId);

	//Sets distance to specified winery
	void SetDistanceToWinery(int wineryId, float dist);

	// Sets distance to Canyon Villas
	void SetDistance(float dist);

	//Sets name of winery
	void SetName(const char *wName);

	// Set winery ID
	void SetId(int wineryId);

	//Returns the name of the winery
	char* GetName();

	// Return winery ID
	int GetId();

	// Return distance to Canyon Villa
	float GetDistance();

	//Adds a wine to the wine array
	void AddWine(Wine newWine);

	//Initializes wines array
	void InitializeWine();

	//Returns a single wine from the array
	Wine GetWine(int index);

	//Outputs wines
	void OutputWineList();

	//Returns the number of wines
	int GetWineNum();

private:
	unsigned int id;				//id of the winery
	char name[MAX_NAME_LENGTH];	//name of the winery
	Wine wines[MAX_WINES];			//list of available wines
	float distance;					// Distance to Canyon Villa
	float distances[MAX_WINERIES];	//distance to other wineries
	unsigned int wineNum;			//number of wines available
};

#endif /* WINERY_H_ */
